From 0c4fa371cac6f6e76bca381cfa2dcc9036f1a0c4 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Thu, 28 Jul 2005 12:33:53 +0000 Subject: [PATCH] Don't unbind port when event channel binding fails. This happens when xend tries to introduce the same domain twice. Signed-off-by: Rusty Russel Signed-off-by: Christian Limpach --- tools/xenstore/xenstored_domain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index 167fa7aa23..ed6cb50599 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -261,8 +261,8 @@ static struct domain *new_domain(void *context, domid_t domid, { struct domain *domain; domain = talloc(context, struct domain); + domain->port = 0; domain->domid = domid; - domain->port = port; domain->path = talloc_strdup(domain, path); domain->page = xc_map_foreign_range(*xc_handle, domain->domid, getpagesize(), @@ -279,9 +279,10 @@ static struct domain *new_domain(void *context, domid_t domid, domain->output = domain->page + getpagesize()/2; /* Tell kernel we're interested in this event. */ - if (ioctl(eventchn_fd, EVENTCHN_BIND, domain->port) != 0) + if (ioctl(eventchn_fd, EVENTCHN_BIND, port) != 0) return NULL; + domain->port = port; domain->conn = new_connection(writechn, readchn); domain->conn->domain = domain; return domain; -- 2.30.2